import axios from "axios";
import request from "../request";

export function getUserTokenStatus(token) {
  return request({
    url: "/user/check-token",
    params: {
      token,
    },
  });
}

export function emailLogin(obj) {
  return request({
    url: "/user/email/login",
    method: "post",
    params: {
      ...obj,
    },
  });
}

export function nameLogin(obj) {
  return request({
    url: "/user/username/login",
    method: "post",
    params: {
      ...obj,
    },
  });
}

export function getUserDetail(token) {
  return request({
    url: "/user/detail",
    params: {
      token,
    },
  });
}

export function setOfficialLogin() {
  return axios({
    url: "https://user.api.it120.cc/login/key",
    method: "post",
    params: {
      merchantNo: "	2101262089656468",
      merchantKey: "8437bd27b8ec8c381de0077fac4876e0",
    },
  });
}

export function getUserArticle(obj) {
  return request({
    url: "/cms/news/list/v2",
    method:'post',
    params:{
      ...obj
    }
  });
}

export function getGoodsList(obj) {
  return request({
    url: "/order/list",
    method:'post',
    params:{
      shopId:30535,
      page:1,
      pageSize:50,
      ...obj
    }
  });
}

export function getGoodsListDetail(obj) {
  return request({
    url: "/order/detail",
    params:{
     ...obj
    }
  });
}